package com.example.airole.llm.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * LLM配置 - 仅支持Ollama本地部署
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "airole.llm")
public class LLMConfig {
    
    /**
     * 是否启用LLM服务
     */
    private boolean enabled = true;
    
    /**
     * Ollama配置
     */
    private OllamaConfig ollama = new OllamaConfig();
    
    /**
     * 默认模型
     */
    private String defaultModel = "qwen3:4b";
    
    /**
     * 最大上下文长度
     */
    private int maxContextLength = 4000;
    
    /**
     * 最大回复长度
     */
    private int maxResponseLength = 2000;
    
    /**
     * 默认温度
     */
    private double defaultTemperature = 0.7;
    
    /**
     * 默认top_p
     */
    private double defaultTopP = 1.0;
    
    /**
     * 请求超时时间(秒)
     */
    private int requestTimeout = 60;
    
    /**
     * 重试次数
     */
    private int retryCount = 3;
    
    @Data
    public static class OllamaConfig {
        private String baseUrl = "http://localhost:11434";
        private String model = "qwen3:4b";
        private String temperature = "0.7";
        private String topP = "1.0";
        private String topK = "40";
        private String repeatPenalty = "1.1";
    }
}

